//package com.ygl.config;
//
//import com.netflix.client.config.IClientConfig;
//import com.netflix.loadbalancer.IRule;
//import com.ygl.example.service.rule.DiscoveryEnabledZoneAvoidancePredicate;
//import com.ygl.example.service.rule.DiscoveryEnabledZoneAvoidanceRule;
//import com.ygl.nacos.configcenter.rule.RuleCache;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.AutoConfigureBefore;
//import org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//@AutoConfigureBefore(RibbonClientConfiguration.class)//'com.netflix.client.config.IClientConfig' that could not be found.
//public class StrategyLoadBalanceConfiguration {
//
//
//    @Autowired
//    private RuleCache ruleCache;
//
//    @Bean
//    public IRule ribbonRule(IClientConfig config) {
//        DiscoveryEnabledZoneAvoidanceRule discoveryEnabledRule = new DiscoveryEnabledZoneAvoidanceRule();
//        discoveryEnabledRule.initWithNiwsConfig(config);
//        DiscoveryEnabledZoneAvoidancePredicate predicate = discoveryEnabledRule.getDiscoveryEnabledZoneAvoidancePredicate();
//        predicate.setRuleCache(ruleCache);
//        return discoveryEnabledRule;
//    }
//}
